package com.tofine.smarthome.model;

import com.activeandroid.Model;
import com.activeandroid.annotation.Column;
import com.activeandroid.annotation.Table;

import java.io.Serializable;
import java.util.List;

/**
 * @author ddMax
 * @since 2016/5/4 16:27.
 */
@Table(name = "SceneDevice")
public class SceneDevice extends Model implements Serializable {

    @Column(name = "scene")
    public Scene scene;
    @Column(name = "device")
    public Device device;

    public List<Scene> scenes() {
        return getMany(Scene.class, "SceneDevice");
    }

    public List<Device> devices() {
        return getMany(Device.class, "SceneDevice");
    }

    public SceneDevice() {}

    public SceneDevice(Scene scene, Device device) {
        this.scene = scene;
        this.device = device;
    }
}
